import typing

from gi.repository import GObject
T = typing.TypeVar("T")

ALPHA_FLOOR: int = 0
ALPHA_FLOOR_F: int = 0
MAJOR_VERSION: int = 0
MICRO_VERSION: int = 114
MINOR_VERSION: int = 1
_namespace: str = "Babl"
_version: str = "0.1"

def component(name: str) -> Object: ...
def conversion_get_destination_space(conversion: Object) -> Object: ...
def conversion_get_source_space(conversion: Object) -> Object: ...
def exit() -> None: ...
def fast_fish(source_format: None, destination_format: None, performance: str) -> Object: ...
def fish(source_format: None, destination_format: None) -> Object: ...
def format(encoding: str) -> Object: ...
def format_exists(name: str) -> int: ...
def format_get_bytes_per_pixel(format: Object) -> int: ...
def format_get_encoding(babl: Object) -> str: ...
def format_get_model(format: Object) -> Object: ...
def format_get_n_components(format: Object) -> int: ...
def format_get_space(format: Object) -> Object: ...
def format_get_type(format: Object, component_index: int) -> Object: ...
def format_has_alpha(format: Object) -> int: ...
def format_is_format_n(format: Object) -> int: ...
def format_is_palette(format: Object) -> int: ...
def format_n(type: Object, components: int) -> Object: ...
def format_with_space(encoding: str, space: Object) -> Object: ...
def get_model_flags(model: Object) -> ModelFlag: ...
def get_name(babl: Object) -> str: ...
def get_version() -> typing.Tuple[int, int, int]: ...
def icc_get_key(icc_data: str, icc_length: int, key: str, language: str, country: str) -> str: ...
def icc_make_space(icc_data: str, icc_length: int, intent: IccIntent, error: str) -> Object: ...
def init() -> None: ...
def introspect(babl: Object) -> None: ...
def model(name: str) -> Object: ...
def model_is(babl: Object, model_name: str) -> int: ...
def model_with_space(name: str, space: Object) -> Object: ...
def new_palette(name: str, format_u8: Object, format_u8_with_alpha: Object) -> Object: ...
def new_palette_with_space(name: str, space: Object, format_u8: Object, format_u8_with_alpha: Object) -> Object: ...
def palette_reset(babl: Object) -> None: ...
def palette_set_palette(babl: Object, format: Object, data: typing.Sequence[int], count: int) -> None: ...
def process(babl_fish: Object, source: None, destination: None, n: int) -> int: ...
def process_rows(babl_fish: Object, source: None, source_stride: int, dest: None, dest_stride: int, n: int, rows: int) -> int: ...
def sampling(horizontal: int, vertical: int) -> Object: ...
def space(name: str) -> Object: ...
def space_from_chromaticities(name: typing.Optional[str], wx: float, wy: float, rx: float, ry: float, gx: float, gy: float, bx: float, by: float, trc_red: Object, trc_green: typing.Optional[Object], trc_blue: typing.Optional[Object], flags: SpaceFlags) -> Object: ...
def space_from_icc(icc_data: str, icc_length: int, intent: IccIntent) -> typing.Tuple[Object, str]: ...
def space_from_rgbxyz_matrix(name: typing.Optional[str], wx: float, wy: float, wz: float, rx: float, gx: float, bx: float, ry: float, gy: float, by: float, rz: float, gz: float, bz: float, trc_red: Object, trc_green: typing.Optional[Object] = None, trc_blue: typing.Optional[Object] = None) -> Object: ...
def space_get(space: Object) -> typing.Tuple[float, float, float, float, float, float, float, float, Object, Object, Object]: ...
def space_get_gamma(space: Object) -> float: ...
def space_get_icc(babl: Object) -> bytes: ...
def space_get_rgb_luminance(space: Object) -> typing.Tuple[float, float, float]: ...
def space_is_cmyk(space: Object) -> int: ...
def space_is_gray(space: Object) -> int: ...
def space_is_rgb(space: Object) -> int: ...
def space_with_trc(space: Object, trc: Object) -> Object: ...
def trc(name: str) -> Object: ...
def trc_gamma(gamma: float) -> Object: ...
def type(name: str) -> Object: ...

class Object(GObject.GPointer): ...

class ModelFlag(GObject.GFlags):
    ALPHA = 2
    ASSOCIATED = 4
    CIE = 8388608
    CMYK = 16777216
    GRAY = 1048576
    INVERTED = 8
    LINEAR = 1024
    NONLINEAR = 2048
    PERCEPTUAL = 4096
    RGB = 2097152

class IccIntent(GObject.GEnum):
    ABSOLUTE_COLORIMETRIC = 3
    PERCEPTUAL = 0
    PERFORMANCE = 32
    RELATIVE_COLORIMETRIC = 1
    SATURATION = 2

class SpaceFlags(GObject.GEnum):
    EQUALIZE = 1
    NONE = 0

